#!/usr/bin/python2.5
# LEAVE THE FOLLOWING TWO LINES
# GAME BAKER
# yaml
# 0
s = """
!!python/object:game.Game
gameobjects:
  BlockObj: &id001 !!python/object:game.GameObject
    baseworkstate: ws_GridController
    name: BlockObj
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 0
  Brick: &id002 !!python/object:game.GameObject
    baseworkstate: ws_Brick
    name: Brick
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 0
gamescreens:
  None: !!python/object:game.GameScreen
    color: !!python/tuple [255, 255, 255]
    dimensions: !!python/tuple [800, 600]
    objtype: Gamescreen
    startobjects:
    - *id001
    - *id002
initcode: from runtime import grid
objtype: Game
sprites: {}
startscreen: None
title: Grid
workstates:
  ws_Brick: !!python/object:game.WorkState
    actions: {1: '

        self.resize(*gamescreen.gameobjects["BlockObj"].foo.block_size)


        gamescreen.gameobjects["BlockObj"].foo.add_object("brick", 8,6)', 3: 'self.x,
        self.y = gamescreen.gameobjects["BlockObj"].foo.get_obj_coords("brick")

        '}
    inherits: null
    objtype: Workstate
  ws_GridController: !!python/object:game.WorkState
    actions: {1: 'self.foo = grid.SquareGrid(16, 12, block_size = (40,30))

        self.resize(*self.foo.block_size)


        self.foo.add_object("obj1", 0,0)

        ', 3: 'self.clear()

        self.x, self.y = self.foo.get_obj_coords("obj1")

        ', 546: 'self.foo.move("obj1", dy = -1)

        ', 548: 'self.foo.move("obj1", dy = 1)

        ', 550: 'self.foo.move("obj1", dx = 1)

        ', 552: 'self.foo.move("obj1", dx = -1)

        '}
    inherits: null
    objtype: Workstate

"""
if __name__ == "__main__":
  import gbfileio,sys,runtime
  game = gbfileio.loadgame(sys.argv[0])
  runtime.run_game(game)
